package ar.com.e2solver.model;

public class Coordinate {

	private int x;
	private int y;
	
	public Coordinate(int x, int y){
		this.x = x;
		this.y = y;
	}

	public int getX() {
		return x;
	}

	public int getY() {
		return y;
	}
	
	@Override
	public boolean equals(Object obj) {
		if(!Coordinate.class.equals(obj.getClass())){
			return false;
		}
		
		Coordinate intPair = (Coordinate)obj; 
		return intPair.getX() == this.getX() && intPair.getY() == this.getY();
	}
	
	@Override
	public int hashCode() {
		return this.getX() * 1000 + this.getY() * 1000;
	}
	
	@Override
	public String toString() {
		return "(" + this.getX() + "," + this.getY() + ")";
	}
}
